home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: newsfeed.internetmci.com!miwok!linex1!news
- From: mfried@linex.com (Marty Fried)
- Subject: Re: Button Problem???
- X-Nntp-Posting-Host: sp91.linex.com
- Message-ID: <316dcbb6.5095149@news.linex.com>
- Sender: news@linex1.linex.com
- Organization: Cirrius Cybernetics Corp
- X-Newsreader: Forte Agent .99e/32.201
- References: <4k5v31$7rs@newsbf02.news.aol.com>
- Date: Fri, 12 Apr 1996 03:27:59 GMT
-
- Once upon a time (OK, it was 6 Apr 1996 09:28:49 -0500), sguit@aol.com
- (SGUIT) wrote:
-
- >I have a Visual C++ 1.52 MFC project that uses buttons in a CFormView. How
- >can I make a button toggle on/off every time it's pressed. I need it to
- >stay down when pressed the first time then up when pressed again. Also, I
- >will need to only execute the code within the OnButton( ); only when it's
- >in its pressed down visual mode.....
- >Thanks.........man, I've looked every where for an example without any
- >luck.
-
- I don't know of any examples. Win95 has a new button-style checkbox,
- that I believe can even be a bitmap. It acts like a checkbox, but
- looks like a button.
-
- I've done something similar with CBitmapButton, where I created a
- padlock symbol that can be locked or unlocked. I had to do something
- sneaky to get it to stay down - I swapped the bitmaps for up and down
- whenever it was clicked. I somehow got rid of the button outline, so
- that only my bitmap was showing. I forget what I did, but I could
- check if it sounds interesting.
-
- Otherwise, creating a bitmap with the up and down bitmaps, and
- bitBlt'ing them on clicks will work. I'd do a CWnd-based class that
- uses a static rect in AppStudio for size and position (destroying it
- after getting the info).
-
- _______________________________________________________
- Marty Fried - mfried@linex.com Press Enter to Exit
- San Anselmo, CA -NT message
- (MSVC4 + MFC) && (Win95 || NT);
-